BaseSubsystem.AddVariable method
Add a user-defined variable.
Namespace: IntervalZero.KINGSTAR.Base.Class
Assembly: IntervalZero.KINGSTAR.Base.Class (in IntervalZero.KINGSTAR.Base.dll) Version: 4.4.0.0
Syntax
IUserVariable AddVariable(
string Name,
KsLogDataType Type,
IUserVariable Parent = null,
long FolderSize = 0
)
Function AddVariable(
Name As String,
Type As KsLogDataType,
Parent = null As IUserVariable,
FolderSize = 0 As Long
) As IUserVariable
Parameters
Name
Type: string
The name of a variable.
Type
Type: KsLogDataType
The data type of a variable.
Parent
Type: IUserVariable
Default value: null
The parent folder of IUserVariable. By default, it adds variables to the root folder.
FolderSize
Type: long
Default value: 0
The FolderSize is used when logDirectory variable is added. By default, you can add up to 64 UserVariable.
- When Parent is set as null, the UserVariable will be added to the default directory, which is the root folder. In such case, the space of the root folder can store up to 64 UserVariable and cannot be changed.
- When Parent is not set as null, the UserVariable will be added to the specified directory. In such case, you can configure the FolderSize of the directory.
- FolderSize = 0, the space of the directory will be applied with the default value, which can store up to 64 UserVariable.
- FolderSize ≠ 0, the space of the directory will be applied with the specified value.
Return value
Type: IUserVariable
Returns a user-defined variable.
Remarks
- The Name string uses UTF-16 encoding.
- You can add up to 64 variables to the root folder.
- The variable can be used in KINGSTAR Scope and a real-time log.
Usable EtherCAT states
ecatOffline, ecatInit, ecatBoot, ecatPreOP, ecatSafeOP, ecatOP
See also